@popconfirm-prefix-cls: ~"@{css-prefix}popconfirm";

@popconfirm-arrow: ~"@{popconfirm-prefix-cls}-arrow";

.@{popconfirm-prefix-cls} {
  display: inline-block;

  &-rel{
    display: inline-block;
    position: relative;
  }

  &-title {
    margin: 0;
    padding: 8px 16px;
    position: relative;

    &:after{
      content: '';
      display: block;
      height: 1px;
      position: absolute;
      left: 8px;
      right: 8px;
      bottom: 0;
      background-color: @border-color-split;
    }

    &-inner{
      color: @color-text-popconfirm;
      font-size: @font-size-base;
      font-weight: 500;
    }
  }

  &-body{
    padding: 8px 16px;

    &-content{
      overflow: auto;

      &-word-wrap{
        white-space: pre-wrap;
        text-align: justify;
      }

      &-inner{
        color: @color-text-popconfirm;
      }
    }
  }

  &-inner{
    width: 100%;
    background-color: @color-bg-popconfirm;
    background-clip: padding-box;
    //border: 1px solid @border-color-split;
    border-radius: @border-radius-small;
    box-shadow: @shadow-base;
    white-space: nowrap;
  }

  &-popper{
    min-width: 150px;
    font-size: @font-size-base;
    .popper(@popconfirm-arrow, @popconfirm-arrow-width, @popconfirm-distance, @popconfirm-arrow-color);

    &[x-placement^="top"] .@{popconfirm-arrow}:after {
      content: " ";
      bottom: 1px;
      margin-left: -@popconfirm-arrow-width;
      border-bottom-width: 0;
      border-top-width: @popconfirm-arrow-width;
      border-top-color: @color-bg-popconfirm;
    }

    &[x-placement^="right"] .@{popconfirm-arrow}:after {
      content: " ";
      left: 1px;
      bottom: -@popconfirm-arrow-width;
      border-left-width: 0;
      border-right-width: @popconfirm-arrow-width;
      border-right-color: @color-bg-popconfirm;
    }

    &[x-placement^="bottom"] .@{popconfirm-arrow}:after {
      content: " ";
      top: 1px;
      margin-left: -@popconfirm-arrow-width;
      border-top-width: 0;
      border-bottom-width: @popconfirm-arrow-width;
      border-bottom-color: @color-bg-popconfirm;
    }

    &[x-placement^="left"] .@{popconfirm-arrow}:after {
      content: " ";
      right: 1px;
      border-right-width: 0;
      border-left-width: @popconfirm-arrow-width;
      border-left-color: @color-bg-popconfirm;
      bottom: -@popconfirm-arrow-width;
    }
  }

  &-arrow{
    &, &:after{
      display: block;
      width: 0;
      height: 0;
      position: absolute;
      border-color: transparent;
      border-style: solid;
    }
  }
  &-arrow {
    border-width: @popconfirm-arrow-outer-width;
  }
  &-arrow:after{
    content: "";
    border-width: @popconfirm-arrow-width;
  }

  &-confirm &-popper{
    max-width: 300px;
  }
  &-confirm &-inner{
    white-space: normal;
  }

  &-confirm &-body{
    padding: 16px 16px 8px;
    .haloe-icon{
      font-size: 16px;
      color: @popconfirm-confirm-icon-color;
      line-height: 18px;
      position: absolute;
    }

    &-message{
      padding-left: 20px;
    }
  }

  &-confirm &-footer{
    text-align: right;
    padding: 8px 16px 16px;
    button {
      margin-left: 4px;
    }
  }
  .popper(@arrow, @arrow-width, @arrow-distance, @bg){
    display: block;
    visibility: visible;
    font-size: @font-size-base;
    line-height: @line-height-base;
    position: absolute;
    z-index: @zindex-tooltip;

    &[x-placement^="top"] {
      padding: @arrow-width 0 @arrow-distance 0;
    }
    &[x-placement^="right"] {
      padding: 0 @arrow-width 0 @arrow-distance;
    }
    &[x-placement^="bottom"] {
      padding: @arrow-distance 0 @arrow-width 0;
    }
    &[x-placement^="left"] {
      padding: 0 @arrow-distance 0 @arrow-width;
    }

    &[x-placement^="top"] .@{arrow} {
      bottom: @arrow-distance - @arrow-width;
      border-width: @arrow-width @arrow-width 0;
      border-top-color: @bg;
    }
    &[x-placement="top"] .@{arrow} {
      left: 50%;
      margin-left: -@arrow-width;
    }
    &[x-placement="top-start"] .@{arrow} {
      left: 16px;
    }
    &[x-placement="top-end"] .@{arrow} {
      right: 16px;
    }

    &[x-placement^="right"] .@{arrow} {
      left: @arrow-distance - @arrow-width;
      border-width: @arrow-width @arrow-width @arrow-width 0;
      border-right-color: @bg;
    }
    &[x-placement="right"] .@{arrow} {
      top: 50%;
      margin-top: -@arrow-width;
    }
    &[x-placement="right-start"] .@{arrow} {
      top: 8px;
    }
    &[x-placement="right-end"] .@{arrow} {
      bottom: 8px;
    }

    &[x-placement^="left"] .@{arrow} {
      right: @arrow-distance - @arrow-width;
      border-width: @arrow-width 0 @arrow-width @arrow-width;
      border-left-color: @bg;
    }
    &[x-placement="left"] .@{arrow} {
      top: 50%;
      margin-top: -@arrow-width;
    }
    &[x-placement="left-start"] .@{arrow} {
      top: 8px;
    }
    &[x-placement="left-end"] .@{arrow} {
      bottom: 8px;
    }

    &[x-placement^="bottom"] .@{arrow} {
      top: @arrow-distance - @arrow-width;
      border-width: 0 @arrow-width @arrow-width;
      border-bottom-color: @bg;
    }
    &[x-placement="bottom"] .@{arrow} {
      left: 50%;
      margin-left: -@arrow-width;
    }
    &[x-placement="bottom-start"] .@{arrow} {
      left: 16px;
    }
    &[x-placement="bottom-end"] .@{arrow} {
      right: 16px;
    }
  }

}
